
<div class="titlebar">
    <div class="fn-left"><i class="iconfont icon-text_icon"></i> 数据统计</div>
    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('VipUser/index',['types' => 0,'vip_id' => $vip_id])}">
            <input placeholder="开始时间" class="input w100 ui-date" type="text" name="starttime" readonly autocomplete="false" value="{$starttime}"/>
            <input placeholder="结束时间" class="input w100 ui-date" type="text" name="endtime" readonly autocomplete="false" value="{$endtime}"/> 
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('vip_user/index',['time' => 1,'types'=>0,'vip_id'=> $vip_id])}" class="button {$time==1?'button-violet':''}">今日</a>
        <a href="{:url('vip_user/index',['time' => 2,'types'=>0,'vip_id'=> $vip_id])}" class="button {$time==2?'button-violet':''}">昨日</a>
        <a href="{:url('vip_user/index',['time' => 30,'types'=>0,'vip_id'=> $vip_id])}" class="button {$time==30?'button-violet':''}"">本月</a>
        <a href="{:url('vip_user/index',['time' => 60,'types'=>0,'vip_id'=> $vip_id])}" class="button {$time==60?'button-violet':''}"">上月</a>
    </div>
</div>
<div class="cards">
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-my_icon"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$vipnum}</div><div class="text">会员数量</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-my_icon"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$store_vipnum}</div><div class="text">好店会员</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-my_icon"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$platform_vipnum}</div><div class="text">平台会员</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$vipamount}</div><div class="text">会员金额</div></div>
    </div>
</div>
<div class="titlebar"><i class="iconfont icon-text_icon"></i>会员列表</div>
<div id="actionbar">
    <div class="fn-left button-group">
        {if $vip_id}
            <a href="javascript:;" url="{:url('VipUser/winuser',['vip_id'=> $vip_id])}" class="button button-blue win"><i class="iconfont icon-add_icon"></i>增加 {$vip.name} 会员用户</a>
        {else}
            <a href="javascript:;" class="button button-disabled"><i class="iconfont icon-add_icon"></i>增加会员用户</a>
        {/if}
    </div>
    <div class="fn-right">
        <form class="input-group" action="{:url('VipUser/index',['types' => $types,'vip_id' => $vip_id])}" method="get">
            <input type="hidden" id="store_id" name="store_id" value="{$store_id}"/>
            <input url="{:url('allwin/store/selectStore')}" id="selectStore" readonly placeholder="好店名称" class="input selectID" type="text" name="store_name" value="{$store_name}" />
            <input url="{:url('system/passport.user/selectUser')}" id="uid"  placeholder="用户ID" class="input w100 selectID" type="text" name="uid" value="{$uid}" />        
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        {volist name="vip_class" id="vo"}
            <a href="{:url('VipUser/index',['time'=>$time,'types' => $types,'vip_id' => $vo.id])}" class="button{if $vip_id == $vo.id} button-green{/if}">
                <i class="iconfont {if $vip_id == $vo.id}icon-my_icon{else}icon-list_icon{/if}"></i>{$vo.name}
            </a>
        {/volist}
        <a href="{:url('VipUser/index',['time'=>$time,'types'=>0,'vip_id'=> $vip_id])}" class="button{if $types == 0} button-violet{/if}">正常</a>
        <a href="{:url('VipUser/index',['time'=>$time,'types'=>1,'vip_id'=> $vip_id])}" class="button{if $types == 1} button-violet{/if}">锁定</a>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w90 fn-tac">社交关系</th>
            <th class="w60 fn-tac"></th>
            <th class="w120">昵称</th>
            <th>好店</th>
            <th>创客</th>
            <th class="w100 fn-tar">付款金额(￥)</th>
            <th class="w100 fn-tar">付款时间</th>
            <th class="w200">付款单号</th>
            <th class="w120 fn-tac">开通时间</th>
            <th class="w70 fn-tac">删除</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td><a class="button button-green fn-left" href="javascript:openwin('{:url('VipUser/level',array('id'=>$vo.user.id))}')" title="关系"><i class="iconfont icon-edit"></i>关系</a></td>
            <td class="fn-tac"><img src="{$vo.user.face}" class="w40" /></td>
            <td><a href="javascript:openwin('{:url('user/review',['uid' => $vo.user.id])}')">{$vo.user.nickname}</a></td>
            <td>{if $vo.allwinUser.store.name}<a href="{:url('store/review',['id' => $vo.allwinUser.store.id])}"><i class="iconfont icon-home_icon"></i> {$vo.allwinUser.store.name}</a>{else}<span class="badge">[无店铺]平台会员</span>{/if}</td>
            <td>{$vo.vipcard.name}{if $vo.is_lock}<span class="badge bg-red m5">锁定</span>{else}<span class="badge m5">正常</span>{/if}</td>
            <td class="fn-tar"><i class="iconfont icon-renminbi1688"></i>{$vo.amount|money}</td>
            <td class="fn-tar">{if $vo.is_diy}<span class="badge bg-blue">平台赠送</span>{else}{if $vo.paid_time}{$vo.paid_time|date="Y-m-d"}{/if}{/if}</td>
            <td>{$vo.order_no}</td>
            <td class="fn-tac">{$vo.update_time|date="Y-m-d"}</td>
            <td class="fn-tac"><a class="button isDel" url="{:url('VipUser/deleteUser',array('uid'=>$vo.user_id))}" href="javascript:;" title="删除">删除</a></td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','form','layer','tip','date', function () {
    $('#form').isForm({types:1});
    $('.isDel').isDel();
    $('.win').win({reload:1});
    $(".selectID").win();
})
function setState(store){
    $("#store_id").val(store.id);
    $("#selectStore").val(store.store_name);
}
</script>